package com.ruoyi.demo.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.demo.mapper.AuctionCategoryMapper;
import com.ruoyi.demo.domain.AuctionCategory;
import com.ruoyi.demo.service.IAuctionCategoryService;

/**
 * 商品分类Service业务层处理
 * 
 * @author metaee
 * @date 2025-02-24
 */
@Service
public class AuctionCategoryServiceImpl implements IAuctionCategoryService 
{
    @Autowired
    private AuctionCategoryMapper auctionCategoryMapper;

    /**
     * 查询商品分类
     * 
     * @param categoryId 商品分类主键
     * @return 商品分类
     */
    @Override
    public AuctionCategory selectAuctionCategoryByCategoryId(Long categoryId)
    {
        return auctionCategoryMapper.selectAuctionCategoryByCategoryId(categoryId);
    }

    /**
     * 查询商品分类列表
     * 
     * @param auctionCategory 商品分类
     * @return 商品分类
     */
    @Override
    public List<AuctionCategory> selectAuctionCategoryList(AuctionCategory auctionCategory)
    {
        return auctionCategoryMapper.selectAuctionCategoryList(auctionCategory);
    }

    /**
     * 新增商品分类
     * 
     * @param auctionCategory 商品分类
     * @return 结果
     */
    @Override
    public int insertAuctionCategory(AuctionCategory auctionCategory)
    {
        auctionCategory.setCreateTime(DateUtils.getNowDate());
        return auctionCategoryMapper.insertAuctionCategory(auctionCategory);
    }

    /**
     * 修改商品分类
     * 
     * @param auctionCategory 商品分类
     * @return 结果
     */
    @Override
    public int updateAuctionCategory(AuctionCategory auctionCategory)
    {
        auctionCategory.setUpdateTime(DateUtils.getNowDate());
        return auctionCategoryMapper.updateAuctionCategory(auctionCategory);
    }

    /**
     * 批量删除商品分类
     * 
     * @param categoryIds 需要删除的商品分类主键
     * @return 结果
     */
    @Override
    public int deleteAuctionCategoryByCategoryIds(Long[] categoryIds)
    {
        return auctionCategoryMapper.deleteAuctionCategoryByCategoryIds(categoryIds);
    }

    /**
     * 删除商品分类信息
     * 
     * @param categoryId 商品分类主键
     * @return 结果
     */
    @Override
    public int deleteAuctionCategoryByCategoryId(Long categoryId)
    {
        return auctionCategoryMapper.deleteAuctionCategoryByCategoryId(categoryId);
    }
}
